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

Query time 0.00047