UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MQ/6amaOPZZiAGPpju4d1A0Qs7zYMP6szAH8sjx7kBU=' 
WHERE 
  key_id = 'b72a6fef79650e7b872ba28493624312faaa53627f1e75db59f20006c3b33999' 
  AND (
    token = 'MQ/6amaOPZZiAGPpju4d1A0Qs7zYMP6szAH8sjx7kBU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021