UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GeqWOjBiXdRTT74470nnrR8TI6JrnromjBQBZTs1SPg=' 
WHERE 
  key_id = 'ef4de3f4d79d7441013ee5103c8cf15a4221892132d3552f2cdbba1ccdc8f4b1' 
  AND (
    token = 'GeqWOjBiXdRTT74470nnrR8TI6JrnromjBQBZTs1SPg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038