UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bVouoZReF6QUvY4JcVuoKtEuj1Jx4efFkk0WxrEkz8M=' 
WHERE 
  key_id = 'd6eb91e5eefea0ad25e4e02ad53fa5e6fa58ec25a23a5fd78ed0124d275ac785' 
  AND (
    token = 'bVouoZReF6QUvY4JcVuoKtEuj1Jx4efFkk0WxrEkz8M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036