UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k+xlAcvCGQspbd3Yf+zhYAQRnPQgjZk4gYqgBRaHvcE=' 
WHERE 
  key_id = 'deff0c45016050f99e56ce7b7d7507f50c04e45bfc0267ea52b14acf74bf15b1' 
  AND (
    token = 'k+xlAcvCGQspbd3Yf+zhYAQRnPQgjZk4gYqgBRaHvcE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041