UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'StMmQQArOAh0gmNXK80+4ed/RATWcgFSIKkoxyriPws=' 
WHERE 
  key_id = '60b4a6d868ece22a629b528c60ebc32b3d7cf7874f7f463c6e2471b4734904b7' 
  AND (
    token = 'StMmQQArOAh0gmNXK80+4ed/RATWcgFSIKkoxyriPws=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029