UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pBf+qCWA/WBurmK/zGgdXmhW+0scVa2NKLiW77W/67M=' 
WHERE 
  key_id = '01d25d3cdc013310adb70453b7a32d24b09541165b3b341a8a18dc3dc54b078d' 
  AND (
    token = 'pBf+qCWA/WBurmK/zGgdXmhW+0scVa2NKLiW77W/67M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033