UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BFU/bI2FIESO8ru1AjmsAkHi3LwDrypXJE5LfGAvXSE=' 
WHERE 
  key_id = '52cae1e6d601d9604e6a91eaad0a05ee8a868699b5927b34b68913cb6ef465f8' 
  AND (
    token = 'BFU/bI2FIESO8ru1AjmsAkHi3LwDrypXJE5LfGAvXSE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029