UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jjv+B+M6iadtCUt3yqdWun0LyftHFCv7fgSIAv0Jp3g=' 
WHERE 
  key_id = 'a2bba2d289b89c5f5bba9bd2cb441473b9f3394ffc3ccda3464e29827e66a952' 
  AND (
    token = 'Jjv+B+M6iadtCUt3yqdWun0LyftHFCv7fgSIAv0Jp3g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030