UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bPdhMYRxnOW4TQ5HoI63RNB1Z6NTZ41an3GFDrrI8Lg=' 
WHERE 
  key_id = '9e2dca223ffbce4948d91b88879b88b2a3b3a95af827dcf5bea30bbfe84e3d3a' 
  AND (
    token = 'bPdhMYRxnOW4TQ5HoI63RNB1Z6NTZ41an3GFDrrI8Lg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021