UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Uye1wf/EDj5kyioIsJKoxI+Wx3Lh7bvNsDKwwdXTFsw=' 
WHERE 
  key_id = 'c5536675e09e9e8d585699fa565ccee80a4af6aa7ad682fb345158e1a336ec7b' 
  AND (
    token = 'Uye1wf/EDj5kyioIsJKoxI+Wx3Lh7bvNsDKwwdXTFsw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038