UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9PX3M/YTmAvaubZwByeS5zma1P4qxVAZL7E4MkengvI=' 
WHERE 
  key_id = 'aae2aca48aa8e1d0fcb588d07da64f6b6fe7e995e8a1587c7e95288f6a416ad0' 
  AND (
    token = '9PX3M/YTmAvaubZwByeS5zma1P4qxVAZL7E4MkengvI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029