UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't84mHu89njMQZxtnJ4/iAWbEypgIV9iKEE69GXbmgAk=' 
WHERE 
  key_id = 'c32c655657dc711c574daf99c2dec12a2f85476d1d3730e3e9920ae0dfd91335' 
  AND (
    token = 't84mHu89njMQZxtnJ4/iAWbEypgIV9iKEE69GXbmgAk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020