UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mkp70dA+ZxWPN9Ql3hBRHXp+DP1X9UxuJdB4UxQa5AI=' 
WHERE 
  key_id = '4a7721812f5fbf06a818cd2ba51ac44a71586f39cb710fcf7a5e70aa3483484a' 
  AND (
    token = 'mkp70dA+ZxWPN9Ql3hBRHXp+DP1X9UxuJdB4UxQa5AI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036