UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mm5ZerkpHd8ads+9s41xhXT0nkrXOxPKX9vxQmrQ/vY=' 
WHERE 
  key_id = '671a9b43f7ae3b0a51dbb5cf6b69bb3fac2dce2e4f03cacd258396941ae42344' 
  AND (
    token = 'Mm5ZerkpHd8ads+9s41xhXT0nkrXOxPKX9vxQmrQ/vY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035