UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Go2szugv/0UjB7RUb7QRsCxMnX7TGZZdyF1d2hAF0PU=' 
WHERE 
  key_id = '96c348e97ce9fd5ece058d9ba85d71952d788b717624f10bc31c4a1d6f472ae1' 
  AND (
    token = 'Go2szugv/0UjB7RUb7QRsCxMnX7TGZZdyF1d2hAF0PU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047