UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pK9ZdfWAUtVLV2EKwbWDkQSvK+jr/FEuzcIMWXoFqyo=' 
WHERE 
  key_id = '1e22bb2d43ef35091c89f4de8c9da5bf235f0f0cc5e7cd2667f5e3872e9803ce' 
  AND (
    token = 'pK9ZdfWAUtVLV2EKwbWDkQSvK+jr/FEuzcIMWXoFqyo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029