UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'El3hRJ6keEv+VNtz1/SzLUiyT5PFpSVQVKwPoRAqwMw=' 
WHERE 
  key_id = '23f55ef063c6fb6a4b489a85e464ba3d6c8f756fb35767c6add50b6fb5d65307' 
  AND (
    token = 'El3hRJ6keEv+VNtz1/SzLUiyT5PFpSVQVKwPoRAqwMw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028