UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WzrWfoObfEQw/o2T/jKAyIsomUhL2ciwEX/t5Sv/spc=' 
WHERE 
  key_id = 'eb4021accb9d52c8a9d198313458b965a15030482bd89377e4683a6d32d41ace' 
  AND (
    token = 'WzrWfoObfEQw/o2T/jKAyIsomUhL2ciwEX/t5Sv/spc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041