UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FpzUm4P36oKO1RJE7HWGyShuQ2J59QkcxHZQKAnnSTs=' 
WHERE 
  key_id = '5825cbc383265cc0471f345751ca5d9cde35604afeaaa072648711aa62699f46' 
  AND (
    token = 'FpzUm4P36oKO1RJE7HWGyShuQ2J59QkcxHZQKAnnSTs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032