UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wnw92XUFRKtJZtYB1kS1c6mjy1e0wEeEW+Xo/rNfX30=' 
WHERE 
  key_id = '11339aaf442c6c2c3c3bea7887ee68a22d3f4730fec5ec7d55ae215c686a93a4' 
  AND (
    token = 'Wnw92XUFRKtJZtYB1kS1c6mjy1e0wEeEW+Xo/rNfX30=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017