UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6IG3AY0f4r2sHuJq52c6gJGmJoLDyhiXQ3refyV37o0=' 
WHERE 
  key_id = '73f2d44e20c2e32e7ea4a2edd6848579e565379ac33e8b347713818eeccf9d28' 
  AND (
    token = '6IG3AY0f4r2sHuJq52c6gJGmJoLDyhiXQ3refyV37o0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050