UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EuM7epkTfowB+jKF7qCwLFVsgbefsbuZRDB4fqEL8mE=' 
WHERE 
  key_id = '84877f99b9ae4dc46f9db2f0159c623726275fbef95e910cae9b83f3191f4cb4' 
  AND (
    token = 'EuM7epkTfowB+jKF7qCwLFVsgbefsbuZRDB4fqEL8mE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047