UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L6MFmoWppYqR0rLFJRcOkM5p0OuSM5TPli54nYyL+sI=' 
WHERE 
  key_id = '177d16e15c24f060bf006865614ca5610d424f8376ad0e7c15d70a0c300d859f' 
  AND (
    token = 'L6MFmoWppYqR0rLFJRcOkM5p0OuSM5TPli54nYyL+sI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033