UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IHxvV8FLdbuORvdMPpauTZa7rknmtoXpQ6Gxv8BNavo=' 
WHERE 
  key_id = '67c6b52ce91ee7971c034b1b75e42f81101fe09045d1bbe3a54a7b6c92d37d6d' 
  AND (
    token = 'IHxvV8FLdbuORvdMPpauTZa7rknmtoXpQ6Gxv8BNavo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022