UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n9OPaDU/wWXs0pg7bbvQO1JRd8wTd6kSqVzuTRTyVCs=' 
WHERE 
  key_id = '3b904b95aa45c37c1d9ded50f2c9ef69cd2f9d40f2c6ea5db57e8c25540e1148' 
  AND (
    token = 'n9OPaDU/wWXs0pg7bbvQO1JRd8wTd6kSqVzuTRTyVCs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018