UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z4zOihU/wH5lh6VI9VFxwvyxRBpmR6oSJ7SLDWMUCL0=' 
WHERE 
  key_id = '91a639cbcc9f5295c9969847747031ac408539f6dd423039cedf19c6168ece5a' 
  AND (
    token = 'z4zOihU/wH5lh6VI9VFxwvyxRBpmR6oSJ7SLDWMUCL0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059