UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FvwzUmDI/h6p1Yt8yQ1kkwwec0a92xUUTY0wUBbGN60=' 
WHERE 
  key_id = '078268cda35896506c95dac59abd82c68718fcdff8f7bca086d1976982fe188d' 
  AND (
    token = 'FvwzUmDI/h6p1Yt8yQ1kkwwec0a92xUUTY0wUBbGN60=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021