UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '09+0v35ptB2ae/MWVbDA6x/YJgUM8Ys7F5qVhCiMwec=' 
WHERE 
  key_id = '0d222071af4da1639079609ec6b7ad6dd2a9bf5ae87067054303edda3b4c947a' 
  AND (
    token = '09+0v35ptB2ae/MWVbDA6x/YJgUM8Ys7F5qVhCiMwec=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044