UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vLIZohcXigaPROmoiptVAOog1FUYDcKMtPS1jVhDnrE=' 
WHERE 
  key_id = '448e384a6ac90ed51c7535572a7746de8b73df95fd3102f7b55901c588812321' 
  AND (
    token = 'vLIZohcXigaPROmoiptVAOog1FUYDcKMtPS1jVhDnrE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044