UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0TNDSkBSZ94lVPRjOZcGspDhzFbTxzRLMm3fo63QeLY=' 
WHERE 
  key_id = 'b3ca3d1c6b31e6c5d55cdb45ed84d805763d65e4288a6dff57408b5a5c313ad6' 
  AND (
    token = '0TNDSkBSZ94lVPRjOZcGspDhzFbTxzRLMm3fo63QeLY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039