UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TxhmJLY/INbODf8DRbsQloxXrBuPQd3KMDNVpe7kpKk=' 
WHERE 
  key_id = '479b8998b17b2dae5ed726ef43a3040448b5bdf9702bc0cc034ea1976802183f' 
  AND (
    token = 'TxhmJLY/INbODf8DRbsQloxXrBuPQd3KMDNVpe7kpKk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029