UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FH6sYCCXGqBBVx4Pi9aDBaJgR4LuzmxBjKSwZcoVsdM=' 
WHERE 
  key_id = '828f9a4c6f8e2277e16e33a85a6cc282fe798038c9c68896b812862602b5b25f' 
  AND (
    token = 'FH6sYCCXGqBBVx4Pi9aDBaJgR4LuzmxBjKSwZcoVsdM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029