UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mQOUgQ0bgXafiafrMyxZPECWDS3o2afE6TlIfbGXiHU=' 
WHERE 
  key_id = '92807dc80cc95d2ddd5c0d56291f763a55978ed13fec1998e1b0578d03896c89' 
  AND (
    token = 'mQOUgQ0bgXafiafrMyxZPECWDS3o2afE6TlIfbGXiHU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017