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

Query time 0.00023