UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hBUt8a7FBLurCdQcmfDNtTTiU/slNw4W1ZyV03hbMhY=' 
WHERE 
  key_id = 'e33582dac02666f3257c8b308eb33e96df23deb055ac4be5336f7e815490d77e' 
  AND (
    token = 'hBUt8a7FBLurCdQcmfDNtTTiU/slNw4W1ZyV03hbMhY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023