UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jUhOeIiIkKdS8Bpxb/MixoGruWOVmMW7WQDvrFlbuLA=' 
WHERE 
  key_id = 'fabb97fb0ece1af54496d35a8b294a666279ce7c127534488d6cade8c36b7714' 
  AND (
    token = 'jUhOeIiIkKdS8Bpxb/MixoGruWOVmMW7WQDvrFlbuLA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027