UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KjeHYo3A5jBIiN3QhkLvnLc4v0VC/cDL8c37CinGB3s=' 
WHERE 
  key_id = 'aecab1fe9518c8218e86d51ea91c4830cab65d0b70a3b3b78de87b72ad5ce3b4' 
  AND (
    token = 'KjeHYo3A5jBIiN3QhkLvnLc4v0VC/cDL8c37CinGB3s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044