UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7ZKQ6IXiX263mM81TgLWcePBpvlBZXOw9+/YqBtIewY=' 
WHERE 
  key_id = '31a0c65e4efebbc9418868a9cff03f6a0ae7ef24524141fc1e418da243645fa0' 
  AND (
    token = '7ZKQ6IXiX263mM81TgLWcePBpvlBZXOw9+/YqBtIewY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031